package com.googlecode.controlecheque.util;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.googlecode.controlecheque.database.Cheque;

public class ChequeData {

	private Date data;
	private List<Cheque> cheques;

	public Date getData() {
		return data;
	}

	public void setData(Date data) {
		this.data = data;
	}

	public List<Cheque> getCheques() {
		if (cheques == null) {
			cheques = new ArrayList<Cheque>();
		}
		return cheques;
	}

	public void setCheques(List<Cheque> cheques) {
		this.cheques = cheques;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((data == null) ? 0 : data.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (!(obj instanceof ChequeData))
			return false;
		ChequeData other = (ChequeData) obj;
		if (data == null) {
			if (other.data != null)
				return false;
		} else if (!data.equals(other.data))
			return false;
		return true;
	}

}
